import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import Sevice from "../src/http/index.js";
import { isAuth } from "../src/utils/nav.js";
import {
  fileDown,
  fileLook,
  filePdf,
  fileDown2,
  getImge,
} from "../src/utils/fileDown.js";
// 引入进度条样式
import "nprogress/nprogress.css";

//引入自定义滚动条
import HappyScroll from "vue-happy-scroll";
import "vue-happy-scroll/docs/happy-scroll.css";

//自动滚动插件
import scroll from "vue-seamless-scroll";

// 炫酷的粒子动效
import VueParticles from "vue-particles";
//弹窗放大
import { flexColumnWidth } from "../src/utils/maxwidth.js";
import "./assets/icons/iconfont.css";
import elDragDialog from "../src/utils/directives";
Vue.directive("el-drag-dialog", elDragDialog); //添加标签事件绑定 可以放大移动弹窗
//弹窗默认点击遮罩改为不关闭 为了防止和拖拽冲突 ，这句需要放在use ElementUI之前（也可以不加这句，自己测试区别）
ElementUI.Dialog.props.closeOnClickModal.default = false;

// 引入图表
import VCharts from "v-charts";
import Print from "vue-print-nb";
Vue.use(VCharts);
Vue.prototype.$bus = new Vue();
// 制作地图
import echarts from "echarts";
Vue.prototype.$echarts = echarts;
Vue.prototype.Sevice = Sevice;
Vue.prototype.isAuth = isAuth;
Vue.prototype.fileDown = fileDown;
Vue.prototype.fileDown2 = fileDown2;
Vue.prototype.getImge = getImge;
Vue.prototype.fileLook = fileLook;
Vue.prototype.filePdf = filePdf;
import china from "echarts/map/json/china.json";
echarts.registerMap("china", china);
// 引入表格
import VueElementExtends from "vue-element-extends";
import "vue-element-extends/lib/index.css";

import "xe-utils";
import VXETable from "vxe-table";
import "vxe-table/lib/style.css";

// 炫酷图标
import dataV from "@jiaminghi/data-view";
// 百度地图
import BaiduMap from "vue-baidu-map";
//富文本
import VueQuillEditor from "vue-quill-editor";
// require styles
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
Vue.use(VueQuillEditor /* { default global options } */);
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: "lhNLHSz6uKFjMewG57l4tEeCWsElzUbW",
});
//
Vue.use(dataV);

Vue.config.productionTip = false;

Vue.use(HappyScroll);

Vue.use(scroll);

Vue.use(VueParticles);

Vue.use(ElementUI);
Vue.use(VueElementExtends);
Vue.use(VXETable);
Vue.use(Print);
// 全局路由守卫
import "./router/permission";

// 全局注册指令
import vPermission from "./directive/permission";
Vue.directive("permission", vPermission);

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
